x86/mem_sharing: use default_access in add_to_physmap
authorTamas K Lengyel <tamas.lengyel@intel.com>
Wed, 5 Feb 2020 12:53:14 +0000 (13:53 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 5 Feb 2020 12:53:14 +0000 (13:53 +0100)
commit2575d77a678ec3156f537b012eb5e797917d4025
tree56ad69a3496d1b678a36f31790f7af0f6de6ec56
parent35374483000fa6fb15968c70f4ae1c7a85baaa80
x86/mem_sharing: use default_access in add_to_physmap

When plugging a hole in the target physmap don't use the access permission
returned by __get_gfn_type_access as it is non-sensical (p2m_access_n) in
the use-case add_to_physmap was intended to be used in. It leads to vm_events
being sent out for access violations at unexpected locations. Make use of
p2m->default_access instead and document the ambiguity surrounding "hole"
types and corner-cases with custom mem_access being set on holes.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/mm/mem_sharing.c